The present invention embodiments relate to a method and device for customizing a model entity (user interface (UI)) presentation, and in particular, to a method and device for customizing a model entity based on a presentation policy.
A model is a primary entity of a model-driven architecture. To some extent, developing a system includes describing and defining the system. One of the defining approaches is to use a program design language, and another approach is to use a model to describe each aspect of the system. Each of the two approaches has its strong and weak points, and the approach of using a model is more abstract and effective. A model is a kind of abstract description for objects. A description of a system is abstract, since a designer can not and need not represent all aspects of the real world. In other words, the system is composed of models. A simple definition of a model is that the model is data concerning data (i.e., metadata as usually used). A model for defining a model is a meta-model, and further, a model for defining a meta-model is referred to as a meta-meta-model.
FIG. 1 is a schematic diagram of a structure of models on each layer.
In FIG. 1, an M0 layer refers to entities in the system, an M1 layer includes models of the system, an M2 layer includes meta-models, and an M3 layer includes a meta-meta-model. The M3 layer is used to define models used by, for example, Unified Modeling Language (UML), Domain-Specific Language (DSL), which are self-described models.
According to the four-layer structure, in all model definitions, reading and accessing of a model can be preformed through a presentation frame for model of Facility (MOF), as long as the meta-model for defining the model can be consistent with the MOF standard.
In known modeling systems, a tree view is a model often used to represent hierarchical data. A different UI presentation is used for the tree view. For example, an approach is to use different node icons, colors, fonts, and sizes to customize a presentation of the tree.
A method and system for representing hierarchical data are described in U.S. Pat. No. 6,496,208, in which a TREE PROVIDER object is included. This object supports tree representation of hierarchical data, and also provides a “score” for each node. This score is used to determine a color of the node, and such a score can be modified by UI control. Each node may have different scores, and represent different colors. Such a mechanism may be used by the user to find trends and abnormalities in data, and such a color code may be used to describe features and properties of the tree node. A property is related to a color, so that different colors may refer to different characteristic values. In the aforementioned '208 patent, a data structure is described by a tree structure, and the user may adjust the presentations of data, such as color and size of words, by adjusting control components, so as to describe the same data with different presentations. However, the model in the '208 patent is fixed and the presentation of which is bonded with its core model. Such a structure makes customization of the coloring scheme limited.
That is, in known methods, since the core model of a tree structure is fixed and corresponds with the fixed hierarchical data, the known coloring customization processes adopted in these methods are relatively fixed.
After constructing a dynamic tree model, the foregoing and existing color customization mechanisms can not accommodate such demands. Besides, in known methods (e.g., products of PureComponents TreeView), a new tree structure (core model) may be created, but the coloring supported by it can only apply a preset color scheme. When there are other coloring demands, the color, font and size of a single node can only be modified manually. Also, the existing products and technologies can not dynamically modify models in runtime and support the coloring schemes corresponding to the dynamic models in real time.